{// 引入标签库 }
<tagLib name="fanwe" />
<include file="Public:header" />
<load href="__TMPL__ThemeFiles/Js/jquery.js" />
<load href="__TMPL__ThemeFiles/Js/jquery.json.js" />
<load href="__TMPL__ThemeFiles/Js/delivery.js" />
<load href='__TMPL__ThemeFiles/Css/jqModal.css' />
<load href='__TMPL__ThemeFiles/Js/jqModal.js' />
<script type="text/javascript">
var FIRST_PRICE = '{%FIRST_PRICE}';
var CONTINUE_PRICE = '{%CONTINUE_PRICE}';
var ALLOW_COD	=	'{%ALLOW_COD}';
var SELECT_REGIONS = '{%SELECT_REGION}';
var SELECT = '{%SELECT}';
var SELECT_REGION_URL = '{:u("RegionConf/listTree",array('ajax'=>2))}';
var CONFIRM_DELETE_REGION = '{%CONFIRM_DELETE_REGION}';
var DELETE_FAILED = '{%DELETE_FAILED}';
var BASE_CURRENCY_UNIT = '{:sprintf(fanweC("BASE_CURRENCY_UNIT"),"")} ';
</script>
	
<div id="main" class="main" >
<div class="content">
<div class="title">{$Think.lang.EDIT_DATA} [ <a href="{:u($module_name.'/index')}">{$Think.lang.BACK_LIST}</a> ]</div>
<div id="result" class="result none"></div>
<form method='post' id="form" name="form" action="{:u('Delivery/update')}"  enctype="multipart/form-data">
<table cellpadding=0 cellspacing=0 class="dataEdit" >
<tr>
	<td class="tRight" width="120">{$Think.lang.DELIVERY_NAME}：</td>
	<td class="tLeft" >
		<fanwe:textbox name="name" class="bLeftRequire" />
	</td>
</tr>
<tr>
	<td class="tRight" width="120">{%DELIVERY_SITE}：</td>
	<td class="tLeft" >
		<fanwe:textbox name="site" class="bLeft" />
	</td>
</tr>
<tr>
	<td class="tRight" width="120">{%DELIVERY_WEIGHT}：</td>
	<td class="tLeft" >
		{%FIRST_WEIGHT}：<input type="text" name="first_weight" class="bLeft short_size" value="{$vo.first_weight|floatval}" />
		{%CONTINUE_WEIGHT}：<input type="text" name="continue_weight" class="bLeft short_size" value="{$vo.continue_weight|floatval}" />
		{%WEIGHT_UNIT}：
		<select name="weight_unit" class="bLeft">
			<foreach name="weight_list" item="weight_item">
				<option value="{$weight_item.id}" <if condition="$vo['weight_unit'] eq $weight_item['id']">selected="selected"</if> >{$weight_item.name}</option>
			</foreach>
		</select>
	</td>
</tr>
<tr>
	<td class="tRight" width="120">{%DELIVERY_FEE}：</td>
	<td class="tLeft" >
		{%FIRST_PRICE}：{:sprintf(fanweC("BASE_CURRENCY_UNIT"),"")} <input type="text" name="first_price" class="bLeft short_size" value="{$vo.first_price|priceVal}" />
		{%CONTINUE_PRICE}：{:sprintf(fanweC("BASE_CURRENCY_UNIT"),"")}  <input type="text" name="continue_price" class="bLeft short_size" value="{$vo.continue_price|priceVal}" />
		{%ALLOW_COD}：<input type="checkbox" name="allow_cod" value="1" <if condition="$vo['allow_cod'] eq 1">checked="checked"</if> />
	</td>
</tr>
<tr>
	<td class="tRight" width="120">{%IS_PROTECT}：</td>
	<td class="tLeft" >		
			<input type="checkbox" name="protect" value="1" onclick="open_protect(this);" <if condition="$vo['protect'] eq 1">checked="checked"</if> />
			{%PROTECT_RADIO}：<input type="text" name="protect_radio" class="bLeft short_size" id="protect_radio" <if condition="$vo['protect'] eq 0">disabled="disabled"</if> value="{$vo.protect_radio|floatval}" />%
			{%PROTECT_PRICE}：{:sprintf(fanweC("BASE_CURRENCY_UNIT"),"")} <input type="text" name="protect_price" class="bLeft short_size" id="protect_price" <if condition="$vo['protect'] eq 0">disabled="disabled"</if> value="{$vo.protect_price|priceVal}" />		
	</td>
</tr>
<tr>
	<td class="tRight" width="120">{%DELIVERY_REGION}：[ <a href="javascript:;" onclick="addDeliveryRegion(); ">+</a> ]</td>
	<td class="tLeft" >
		<div class="region_list" id="region_list">
		<foreach name="region_list" item="region_item">
		<div style='margin-bottom:5px;'><input type='hidden' name='ids[]' value='{$region_item.id}' />{%FIRST_PRICE}：{:sprintf(fanweC("BASE_CURRENCY_UNIT"),"")} <input type='text' class='bLeft short_size' name='region_first_price[]' value="{$region_item.first_price|priceVal}" /> 
	      {%CONTINUE_PRICE}：{:sprintf(fanweC("BASE_CURRENCY_UNIT"),"")} <input type='text' class='bLeft short_size' name='region_continue_price[]' value="{$region_item.continue_price|priceVal}"/> 
	      {%ALLOW_COD}：<input type='checkbox' value='1' onclick='sw_allow_cod(this);' <if condition="$region_item['allow_cod'] eq 1">checked="checked"</if> /> <input type='hidden' class='region_allow_cod' name='region_allow_cod[]' value="{$region_item.allow_cod}" />
		  {%SELECT_REGION}：<a href='javascript:;' onclick='openJqModal(this);' id='a_{$key}' >{%SELECT}</a>
			<input type='text' class='bLeft region_names' name='region_names[]' onclick='openJqModal(this);' id='i_{$key}'  value="{$region_item.names}" /> 
			[ <a href='javascript:;' onclick='delDeliveryRegion(this,{$region_item.id});' >-</a> ]<input type='hidden' name='region_ids[]' class='region_ids' value="{$region_item.region_ids}" /></div>
		</foreach>
		</div>
	</td>
</tr>
<tr>
	<td class="tRight" width="120">{%ALLOW_DEFAULT}：</td>
	<td class="tLeft" >
		<input type="checkbox" name="allow_default" value="1" <if condition="$vo['allow_default'] eq 1">checked="checked"</if> />
	</td>
</tr>
<tr>
	<td class="tRight" width="120">{%SORT}：</td>
	<td class="tLeft" >
		<input type="text" name="sort" class="bLeft short_size" value="{$vo.sort}" />
	</td>
</tr>
<tr>
	<td class="tRight" width="120">上门自取,免费运费,不填地址：</td>
	<td class="tLeft" >
		<select name="is_smzq" class="bLeft" >
           <option value="0" <if condition="$vo['is_smzq'] eq 0">selected="selected"</if>>否</option>
           <option value="1" <if condition="$vo['is_smzq'] eq 1">selected="selected"</if>>是</option>
		</select>	
	</td>
</tr>

<tr>
	<td class="tRight" width="120">默认快递公司：</td>
	<td class="tLeft" >
		<select class="bLeft"  NAME="express_id"  id ="express_id">
			<iterate name="ExpressModeList" id="emlist">
				<option value={$emlist.id} <if condition="$vo.express_id eq $emlist['id']"> selected</if> >{$emlist.name}</option>
			</iterate>
		</select>	
	</td>
</tr>

<tr>
	<td class="tRight" width="120">{%DESCRIPTION}：</td>
	<td class="tLeft" >
		<fanwe:textarea name="desc" rows="3" cols="50" class="bLeft" />
	</td>
</tr>
<tr>
	<td></td>
	<td class="center"><div style="width:85%;margin:5px">
	<input name="id" value="{$vo.id}" type="hidden" />
	<input type="submit" value="{$Think.lang.SAVE_DATA}"  class="button small"> <input type="reset" class="button small" onclick="resetEditor()" value="{$Think.lang.RESET_DATA}" > 
	</div></td>
</tr>
</form>
</table>
</div>
</div>
<a class='selectbox_trigger'></a>
<div id="selectbox" class="jqmDialog jqmWindow" style="width:500px;">
<div id="loader_region" >{$Think.lang.PAGE_LOADING}</div>
<div class="jqmdTC">{%SELECT_REGION}</div>
<div class="jqmdBL"><div class="jqmdBR"><div class="jqmdBC">

<div class="jqmdMSG" style="overflow-y: auto; height:300px; overflow-x: hidden;  ">
</div>

</div></div></div>
<input type="hidden" value="1" id="is_close" />
<input type="button" value="{%CLOSE}" class="jqmdX jqmClose" onclick="$('#is_close').val(0);"/>
<input type="button" value="{%RESET}" class="jqmCloseNoAction" onclick="return resetRegionTree();"/>
<input type="button" value="{%SELECT}" class="jqmdX jqmClose" />
</div>
